package com.ruoyi.orders.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 采购订单明细对象 order_detail
 * 
 * @author ruoyi
 * @date 2025-04-12
 */
public class OrderDetail extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键id */
    private Long id;

    /** 订单id */
    @Excel(name = "订单id")
    private Long orderId;

    /** 药品id */
    @Excel(name = "药品id")
    private Long medicationId;

    /** 供应商id */
    @Excel(name = "供应商id")
    private Long supplierId;

    /** 采购数量 */
    @Excel(name = "采购数量")
    private Long quantity;

    /** 单价 */
    @Excel(name = "单价")
    private BigDecimal price;

    /** 药物有效期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "药物有效期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expirationDate;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setMedicationId(Long medicationId) {
        this.medicationId = medicationId;
    }

    public Long getMedicationId() {
        return medicationId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setQuantity(Long quantity) {
        this.quantity = quantity;
    }

    public Long getQuantity() {
        return quantity;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Date getExpirationDate() {
        return expirationDate;
    }

    public void setExpirationDate(Date expirationDate) {
        this.expirationDate = expirationDate;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("orderId", getOrderId())
                .append("medicationId", getMedicationId())
                .append("supplierId", getSupplierId())
                .append("quantity", getQuantity())
                .append("price", getPrice())
                .append("expirationDate", getExpirationDate())
                .toString();
    }
}
